import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ttq
 * Date: 13-8-8
 * Time: 下午2:51
 * To change this template use File | Settings | File Templates.
 */
public class TransactionRun {
    public IPersonDao getPersonDao() {
        return personDao;
    }

    public void setPersonDao(IPersonDao personDao) {
        this.personDao = personDao;
    }

    private IPersonDao personDao;

    public void run() {
        Person person = new Person();
        person.setName("事务回滚1");
        person.setAge(30);
        person.setSex("man");
        person.setBirthday(new Date());
        personDao.addPerson(person);
        System.out.println("Count:" + personDao.getPersonsCount());
        System.out.println(personDao.getPersonName(Integer.MAX_VALUE));
        List<Person> personList = personDao.finAllPersons();
        for (Person p : personList) {
            System.out.println("Name:" + person.getName());
        }
    }
}
